using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;


namespace common.pages
{
	public partial class Master : System.Web.UI.MasterPage
	{
		

		#region Properties
        
		public string Title
		{
			set
			{
				this.hfCenterTitle.Value = value;
			}
		}

		#endregion

		/// <summary>
		/// 
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		protected void Page_Load(object sender, EventArgs e)
		{
            string script = string.Empty;
            if (Request.Url.ToString().ToLower().Contains("login.aspx"))
                script = "InitViewPort(true);";
            else
                script = "InitViewPort(false);";
            
            ScriptManager.RegisterStartupScript(this, this.GetType(), "script_InsMsgHeader", script, true);

            if (IsPostBack)
				return;
		}

        protected virtual void Page_PreRender(object sender, EventArgs e)
        {
           
        }
		/// <summary>
		/// 
		/// </summary>
		

		/// <summary>
		/// 
		/// </summary>
		/// <param name="msg"></param>
		public void ShowMessageList(string msg, Boolean show)
		{
			string inner = "<div class='header-panel'>";
                inner += "<div class='header-text'>";
                inner += "<div class='colonna'>";
                //inner += "<div class='header-icon' + ' ' + icon + '></div>";
                inner += "</div>";
                inner += "<div class='header-label'>";
                inner += "<label>" + "Errore" + "</label>";
                inner += "</div>";
                inner += "</div>";
                inner += "</div>";
                
            litErrore.Text = string.Empty;
            litMsgErrore.Text = msg;
            if(show)
            {
                pnlContainerMsg.Visible = show;
                litErrore.Text = inner;
            }
            else
                pnlContainerMsg.Visible = show;

			upMessaggi.Update();
		}

		
	}
}
